home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / util / boot / snap_v2_0.lha / Snap / Windows.c < prev   
C/C++ Source or Header  |  1995-09-10  |  13KB  |  695 lines

  1. /* Auto: make "CCEXTRA=-wq -qf"
  2.  */
  3.  
  4. #include "Snap.h"
  5.  
  6. IMPORT BOOL Kick36;
  7.  
  8. struct Window *ControlWindow = NULL;
  9.  
  10. extern char Version[];
  11. IMPORT struct MsgPort *Sharedport;
  12. IMPORT WORD Sharedrefs;
  13. IMPORT struct Window *SaveWin;
  14.  
  15. IMPORT LONG TopBar;
  16. IMPORT LONG LeftBar;
  17. IMPORT LONG RightBar;
  18. IMPORT LONG BottomBar;
  19. IMPORT LONG ScreenFontHeight;
  20. IMPORT struct TextFont *ScreenFont;
  21. IMPORT struct RastPort MyRP;
  22.  
  23. #define IDCMPFLAGS (MOUSEMOVE | NEWSIZE | CLOSEWINDOW | GADGETUP | ACTIVEWINDOW | INACTIVEWINDOW | MOUSEBUTTONS)
  24.  
  25. UBYTE *WindowTitle = (UBYTE *) Version[ 5];
  26.  
  27. /* Important!
  28.  * The Inactive Image structs contains the values to be used with Kickstart >= 36.
  29.  * The Active Image structs contains the values to be used with Kickstart < 36.
  30.  * The Image structs are copied accordingly in OpenStuff().
  31.  */
  32.  
  33. struct Image InactiveDiskImage =
  34. {
  35.     0, 0,
  36.     18, 12, 2,
  37.     NULL,
  38.     0x03, 0x00,
  39.     NULL
  40. };
  41.  
  42. struct Image ActiveDiskImage =
  43. {
  44.     -1, -1,
  45.     15, 13, 1,
  46.     NULL,
  47.     0x01, 0x00,
  48.     NULL
  49. };
  50.  
  51. struct Image SelDiskImage =
  52. {
  53.     0, 0,
  54.     18, 12, 2,
  55.     NULL,
  56.     0x03, 0x00,
  57.     NULL
  58. };
  59.  
  60. #if 0
  61. struct Image DiskImage =
  62. {
  63.     0, 0,
  64.     18, 13, 1,
  65.     NULL,
  66.     0x01, 0x00,
  67.     NULL
  68. };
  69.  
  70. #endif
  71.  
  72. struct Image InactiveClipImage =
  73. {
  74.     0, 0,
  75.     18, 13, 2,
  76.     NULL,
  77.     0x03, 0x00,
  78.     NULL
  79. };
  80.  
  81. struct Image ActiveClipImage =
  82. {
  83.     -1, 0,
  84.     15, 14, 1,
  85.     NULL,
  86.     0x01, 0x00,
  87.     NULL
  88. };
  89.  
  90. struct Image SelClipImage =
  91. {
  92.     0, 0,
  93.     18, 13, 2,
  94.     NULL,
  95.     0x03, 0x00,
  96.     NULL
  97. };
  98.  
  99. struct Gadget DiskGad =
  100. {
  101.     NULL,
  102.     -12, 10,
  103.     10, 12,
  104.     GADGIMAGE | GRELRIGHT,
  105.     RIGHTBORDER | RELVERIFY,
  106.     BOOLGADGET,
  107.     (APTR) & InactiveDiskImage,
  108.     (APTR) & SelDiskImage,
  109.     NULL,
  110.     0L,
  111.     NULL,
  112.     DISKGAD,
  113.     NULL,
  114. };
  115.  
  116. struct Gadget ClipGad =
  117. {
  118.     NULL,
  119.     -12, 10,
  120.     10, 13,
  121.     GADGIMAGE | GRELRIGHT,
  122.     RIGHTBORDER | RELVERIFY,
  123.     BOOLGADGET,
  124.     (APTR) & InactiveClipImage,
  125.     (APTR) & SelClipImage,
  126.     NULL,
  127.     0L,
  128.     NULL,
  129.     CLIPGAD,
  130.     NULL,
  131. };
  132.  
  133. struct Gadget VProp =
  134. {
  135.     NULL,
  136.     -12, 10,
  137.     10, -15,
  138.     GADGHCOMP | GRELRIGHT | GRELHEIGHT,
  139.     RIGHTBORDER | GADGIMMEDIATE | FOLLOWMOUSE | RELVERIFY,
  140.     PROPGADGET,
  141.     NULL,
  142.     NULL,
  143.     NULL,
  144.     0L,
  145.     NULL,
  146.     VPROP,
  147.     NULL
  148. };
  149.  
  150. struct Gadget HProp =
  151. {
  152.     NULL,
  153.     4, -6,
  154.     -23, 5,
  155.     GADGHCOMP | GRELBOTTOM | GRELWIDTH,
  156.     BOTTOMBORDER | GADGIMMEDIATE | FOLLOWMOUSE | RELVERIFY,
  157.     PROPGADGET,
  158.     NULL,
  159.     NULL,
  160.     NULL,
  161.     0L,
  162.     NULL,
  163.     HPROP,
  164.     NULL
  165. };
  166.  
  167. struct PropInfo VInfo =
  168. {
  169.     AUTOKNOB | FREEVERT | PROPBORDERLESS,
  170.     0, 0,
  171.     MAXBODY, MAXBODY,
  172.     0, 0, 0, 0, 0, 0
  173. };
  174.  
  175. struct PropInfo HInfo =
  176. {
  177.     AUTOKNOB | FREEHORIZ | PROPBORDERLESS,
  178.     0, 0,
  179.     MAXBODY, MAXBODY,
  180.     0, 0, 0, 0, 0, 0
  181. };
  182.  
  183. struct Image VImage =
  184. {
  185.     0, 0, 0, 0, 0, NULL, 0, 0, NULL
  186. };
  187. struct Image HImage =
  188. {
  189.     0, 0, 0, 0, 0, NULL, 0, 0, NULL
  190. };
  191.  
  192. /* Window structure for snapped gfx */
  193. struct NewWindow Nw =
  194. {
  195.     0, 1,            /* LeftEdge, TopEdge  */
  196.     0, 0,            /* Width, Height */
  197.     (UBYTE)-1, (UBYTE)-1,            /* DetailPen, BlockPen */
  198.     NULL,            /* IDCMPFlags */
  199.     WINDOWDRAG | WINDOWDEPTH | WINDOWCLOSE | WINDOWSIZING | RMBTRAP,
  200.     NULL, NULL,        /* FirstGadget, CheckMark */
  201.     NULL,
  202.     NULL, NULL,        /* Screen, BitMap */
  203.     0, 0,            /* MinWidth, MinHeight */
  204.     0, 0,            /* MaxWidth, MaxHeight */
  205.     WBENCHSCREEN        /* Type */
  206. };
  207.  
  208. SHORT Coords3[5][2] =
  209. {
  210.     {0, 0},
  211.     {74, 0},
  212.     {74, 10},
  213.     {0, 10},
  214.     {0, 0}
  215. };
  216.  
  217. SHORT Coords2[5][2] =
  218. {
  219.     {0, 0},
  220.     {74, 0},
  221.     {74, 10},
  222.     {0, 10},
  223.     {0, 0}
  224. };
  225.  
  226. SHORT Coords1[5][2] =
  227. {
  228.     {0, 0},
  229.     {34, 0},
  230.     {34, 10},
  231.     {0, 10},
  232.     {0, 0}
  233. };
  234.  
  235. struct Border Border3 =
  236. {
  237.     -1, -2,
  238.     1, 0,
  239.     JAM1,
  240.     5,
  241.     (SHORT *) &Coords3,
  242.     NULL
  243. };
  244.  
  245. struct Border Border2 =
  246. {
  247.     -1, -1,
  248.     1, 0,
  249.     JAM1,
  250.     5,
  251.     (SHORT *) &Coords2,
  252.     NULL
  253. };
  254.  
  255. struct Border Border1 =
  256. {
  257.     -1, -1,
  258.     1, 0,
  259.     JAM1,
  260.     5,
  261.     (SHORT *) &Coords1,
  262.     NULL
  263. };
  264.  
  265. UBYTE TranspBuf[5];
  266.  
  267. struct StringInfo TranspSI =
  268. {
  269.     TranspBuf,        /* Buf */
  270.     NULL,            /* UndoBuf */
  271.     0,            /* BufferPos */
  272.     4,            /* MaxChars */
  273.     0,            /* DispPos */
  274.     0,            /* UndoPos */
  275.     0,            /* NumChars */
  276.     0,            /* DispCount */
  277.     0, 0,            /* CLeft, CTop */
  278.     NULL,            /* Layer */
  279.     0L,            /* LongInt */
  280.     NULL            /* AltKeyMap */
  281. };
  282.  
  283. struct Gadget TranspGad =
  284. {
  285.     NULL,
  286.     5, 16,
  287.     32, 8,
  288.     LONGINT,
  289.     RELVERIFY,
  290.     STRGADGET,
  291.     (APTR) & Border3,
  292.     NULL,
  293.     NULL,
  294.     0L,
  295.     (APTR) & TranspSI,
  296.     0,
  297.     NULL,
  298. };
  299.  
  300. IMPORT char SaveName[DSIZE + FCHARS + 2];
  301.  
  302. struct StringInfo NameSI =
  303. {
  304.     (UBYTE *) SaveName,    /* Buf */
  305.     NULL,            /* UndoBuf */
  306.     0,            /* BufferPos */
  307.     DSIZE + FCHARS,        /* MaxChars */
  308.     0,            /* DispPos */
  309.     0,            /* UndoPos */
  310.     0,            /* NumChars */
  311.     0,            /* DispCount */
  312.     0, 0,            /* CLeft, CTop */
  313.     NULL,            /* Layer */
  314.     0L,            /* LongInt */
  315.     NULL            /* AltKeyMap */
  316. };
  317.  
  318. struct Gadget NameGad =
  319. {
  320.     &TranspGad,
  321.     5, 16,
  322.     32, 8,
  323.     NULL,
  324.     NULL,
  325.     NULL,
  326.     (APTR) & Border2,
  327.     NULL,
  328.     NULL,
  329.     0L,
  330.     NULL,
  331.     NAMEGAD,
  332.     NULL,
  333. };
  334.  
  335. struct Gadget SaveGad =
  336. {
  337.     &NameGad,
  338.     5, 16,
  339.     32, 8,
  340.     GADGHCOMP,
  341.     RELVERIFY,
  342.     BOOLGADGET,
  343.     (APTR) & Border1,
  344.     NULL,
  345.     NULL,
  346.     0L,
  347.     NULL,
  348.     SAVEGAD,
  349.     NULL,
  350. };
  351.  
  352. /* Window structure for control window */
  353. struct NewWindow NewCW =
  354. {
  355.     10, 10,            /* LeftEdge, TopEdge  */
  356.     326, 40,        /* Width, Height */
  357.     (UBYTE)-1, (UBYTE)-1,            /* DetailPen, BlockPen */
  358.     NULL,            /* IDCMPFlags */
  359.     WINDOWDRAG | WINDOWDEPTH | WINDOWCLOSE | ACTIVATE |
  360.     SMART_REFRESH | NOCAREREFRESH | RMBTRAP,
  361.     NULL, NULL,        /* FirstGadget, CheckMark */
  362.     (UBYTE *) "Snap Control Window",
  363.     NULL, NULL,        /* Screen, BitMap */
  364.     32, 32,            /* MinWidth, MinHeight */
  365.     (UWORD)-1, (UWORD)-1,            /* MaxWidth, MaxHeight */
  366.     WBENCHSCREEN        /* Type */
  367. };
  368.  
  369. #ifdef REQLIB
  370. IMPORT struct ReqFileRequester *NameFR;
  371.  
  372. #endif    /* REQLIB */
  373. #ifdef ASLLIB
  374. IMPORT struct FileRequester *AslNameFR;
  375.  
  376. #endif    /* ASLLIB */
  377.  
  378. struct Window *opensharedwindow(nw)
  379.     struct NewWindow *nw;
  380. {
  381.     struct Window *win;
  382.     struct Screen scr;
  383.  
  384.     if (!GetScreenData((char *)&scr, (LONG) sizeof (struct Screen),
  385.                WBENCHSCREEN, NULL))
  386.     {
  387.         return NULL;    /* No WB */
  388.     }
  389.     if (nw->TopEdge + nw->Height > scr.Height)
  390.     {
  391.         nw->TopEdge = scr.Height - nw->Height;
  392.     }
  393.     if (nw->LeftEdge + nw->Width > scr.Width)
  394.     {
  395.         nw->LeftEdge = scr.Width - nw->Width;
  396.     }
  397.     if (nw->TopEdge < 0)
  398.     {
  399.         nw->TopEdge = 0;
  400.     }
  401.     if (nw->LeftEdge < 0)
  402.     {
  403.         nw->LeftEdge = 0;
  404.     }
  405.     if (nw->TopEdge + nw->Height > scr.Height)
  406.     {
  407.         nw->Height = scr.Height - nw->TopEdge;
  408.     }
  409.     if (nw->LeftEdge + nw->Width > scr.Width)
  410.     {
  411.         nw->Width = scr.Width - nw->LeftEdge;
  412.     }
  413.  
  414.     nw->IDCMPFlags = NULL;
  415.  
  416.     if (win = OpenWindow(nw))
  417.     {
  418.         if (!Sharedport && !(Sharedport = CreatePort(0L, 0L)))
  419.         {
  420.             return NULL;
  421.         }
  422.         win->UserPort = Sharedport;
  423.         ModifyIDCMP(win, IDCMPFLAGS);
  424.         ++Sharedrefs;
  425.     }
  426.     return (win);
  427. }
  428.  
  429.  
  430. VOID closesharedwindow(win)
  431.     struct Window *win;
  432. {
  433.     REGISTER struct IntuiMessage *im, *safe;
  434.  
  435.     Forbid();
  436.     Sharedrefs--;
  437.     SAFEMAPLIST(&win->UserPort->mp_MsgList,
  438.             struct IntuiMessage *, im, safe)
  439.     {
  440.         if (im->IDCMPWindow == win)
  441.         {
  442.             Remove((struct Node *)im);
  443.             ReplyMsg((struct Message *)im);
  444.         }
  445.     }
  446.     win->UserPort = NULL;
  447.     ModifyIDCMP(win, NULL);
  448.     Permit();
  449.     CloseWindow(win);
  450.     if (!Sharedrefs)
  451.     {
  452.         DeletePort(Sharedport);
  453.         Sharedport = NULL;
  454.     }
  455. }
  456.  
  457. VOID SetUpBorder(Border, Gad)
  458.     struct Border *Border;
  459.     struct Gadget *Gad;
  460. {
  461.     Border->XY[2] = Border->XY[4] = Gad->Width + 1;
  462.     Border->XY[5] = Border->XY[7] = Gad->Height + 1;
  463. }
  464.  
  465. VOID DrawOldBorders( struct GfxSnap *GS)
  466. {
  467.     REGISTER LONG right;
  468.     REGISTER LONG bottom;
  469.  
  470.     if (!Kick36)
  471.     {
  472.         right = GS->window->Width - GS->rightbar;
  473.         bottom = GS->window->Height - GS->bottombar;
  474.         SetDrMd(GS->window->RPort, JAM1);
  475.         SetAPen(GS->window->RPort, 0L);
  476.         Move(GS->window->RPort, 2L, bottom);
  477.         Draw(GS->window->RPort, right, bottom);
  478.         Move(GS->window->RPort, 2L, bottom + 2);
  479.         Draw(GS->window->RPort, right, bottom + 2);
  480.         Move(GS->window->RPort, right, (LONG) GS->topbar);
  481.         Draw(GS->window->RPort, right, bottom);
  482.         Draw(GS->window->RPort, right + 1, bottom);
  483.         Draw(GS->window->RPort, right + 1, (LONG) GS->topbar);
  484.         SetAPen(GS->window->RPort, 1L);
  485.         Move(GS->window->RPort, right + 2, (LONG) GS->topbar);
  486.         Draw(GS->window->RPort, right + 2, bottom);
  487.         Draw(GS->window->RPort, right + 3, bottom);
  488.         Draw(GS->window->RPort, right + 3, (LONG) GS->topbar);
  489.         Move(GS->window->RPort, 2L, bottom + 1);
  490.         Draw(GS->window->RPort, right + 1, bottom + 1);
  491.     }
  492. }
  493.  
  494. VOID AdjustSize(GS)
  495.     struct GfxSnap *GS;
  496. {
  497.     ULONG w = GS->window->Width - GS->leftbar - GS->rightbar;
  498.     ULONG h = GS->window->Height - GS->topbar - GS->bottombar;
  499.     ULONG vb, hb;
  500.  
  501.     vb = hb = MAXBODY;
  502.  
  503.     if (w < GS->width)
  504.     {
  505.         hb = w * (ULONG) MAXBODY / GS->width;
  506.     }
  507.     if (h < GS->height)
  508.     {
  509.         vb = h * (ULONG) MAXBODY / GS->height;
  510.     }
  511.     NewModifyProp(&GS->VProp, GS->window, NULL,
  512.               (ULONG) AUTOKNOB | FREEVERT | PROPBORDERLESS,
  513.               0L, 0L, (ULONG) MAXBODY, vb, 1L);
  514.     NewModifyProp(&GS->HProp, GS->window, NULL,
  515.               (ULONG) AUTOKNOB | FREEHORIZ | PROPBORDERLESS,
  516.               0L, 0L, hb, (ULONG) MAXBODY, 1L);
  517.     RefreshWindowFrame(GS->window);
  518.     DrawOldBorders(GS);
  519.     InitRastPort(&MyRP);
  520.     MyRP.BitMap = GS->BitMap;
  521.     SetAPen(GS->window->RPort, 0);
  522.     RectFill(GS->window->RPort,
  523.          (LONG) GS->leftbar, (LONG) GS->topbar,
  524.          (LONG) GS->leftbar + w - 1, (LONG) GS->topbar + h - 1);
  525.     if (w > GS->width)
  526.         w = GS->width;
  527.     if (h > GS->height)
  528.         h = GS->height;
  529.     ClipBlit(&MyRP, 0L, 0L, GS->window->RPort,
  530.          (LONG) GS->leftbar, (LONG) GS->topbar, w, h, 0xC0L);
  531. }
  532.  
  533. VOID SyncGS(GS)
  534.     struct GfxSnap *GS;
  535. {
  536.     ULONG w = GS->window->Width - GS->leftbar - GS->rightbar;
  537.     ULONG h = GS->window->Height - GS->topbar - GS->bottombar;
  538.     ULONG vpos, hpos;
  539.     LONG temp;
  540.  
  541.     temp = GS->width - w;
  542.     if (temp <= 0)
  543.     {
  544.         hpos = 0;
  545.     }
  546.     else
  547.     {
  548.         hpos = temp * (LONG) GS->HInfo.HorizPot / MAXBODY;
  549.         if (hpos > temp)
  550.         {
  551.             hpos = temp;
  552.         }
  553.     }
  554.     temp = GS->height - h;
  555.     if (temp <= 0)
  556.     {
  557.         vpos = 0;
  558.     }
  559.     else
  560.     {
  561.         vpos = temp * (LONG) GS->VInfo.VertPot / MAXBODY;
  562.         if (vpos > temp)
  563.         {
  564.             vpos = temp;
  565.         }
  566.     }
  567.     DrawOldBorders(GS);
  568.     InitRastPort(&MyRP);
  569.     MyRP.BitMap = GS->BitMap;
  570.     if (w > GS->width)
  571.     {
  572.         w = GS->width;
  573.     }
  574.     if (h > GS->height)
  575.     {
  576.         h = GS->height;
  577.     }
  578.     ClipBlit(&MyRP, hpos, vpos, GS->window->RPort,
  579.          (LONG) GS->leftbar, (LONG) GS->topbar, w, h, 0xC0L);
  580. }
  581.  
  582. SHORT OpenCW()
  583. {
  584.     WORD temp;
  585.     struct RastPort TmpRP;
  586.  
  587.     FixHeights();
  588.  
  589.     InitRastPort(&TmpRP);
  590.     SetFont(&TmpRP, ScreenFont);
  591.  
  592.     SaveGad.TopEdge = NameGad.TopEdge = TopBar + 2;
  593.     SaveGad.Height = NameGad.Height = TranspGad.Height = ScreenFontHeight + 2;
  594.  
  595.     TranspGad.TopEdge = SaveGad.TopEdge + SaveGad.Height + 5;
  596.  
  597.     SaveGad.LeftEdge = LeftBar + 2;
  598.     SaveGad.Width = TextLength(&TmpRP, "Save", 4L) + 1;
  599.     SaveGad.Flags |= GADGDISABLED;
  600.  
  601.     NameGad.LeftEdge = SaveGad.LeftEdge +
  602.         TextLength(&TmpRP, "Save as ", 8L);
  603.  
  604.     temp = 322 - NameGad.LeftEdge;
  605.     NameGad.Width =
  606.         temp - (temp % TextLength(&TmpRP, " ", 1L)) + 1;
  607.  
  608.     TranspGad.LeftEdge = SaveGad.LeftEdge +
  609.         TextLength(&TmpRP, "Transparent color ", 18L);
  610.     TranspGad.Width = TextLength(&TmpRP, "0000", 4L) + 2;
  611.  
  612.     NewCW.Height = TopBar + BottomBar + ScreenFontHeight * 2 + 12;
  613.  
  614. #define dmax(a,b) ((a>b)?a:b)
  615.     NewCW.Width = dmax((TranspGad.LeftEdge + TranspGad.Width + 2 + RightBar), (NameGad.LeftEdge + NameGad.Width + 2 + RightBar));
  616. #undef dmax
  617.  
  618.     ControlWindow = opensharedwindow(&NewCW);
  619.     if (!ControlWindow)
  620.     {
  621.         return 0;
  622.     }
  623.     SetFont(ControlWindow->RPort, ScreenFont);
  624.     ModifyIDCMP(ControlWindow, ControlWindow->IDCMPFlags & ~NEWSIZE);
  625.  
  626.     SetUpBorder(&Border1, &SaveGad);
  627.     SetUpBorder(&Border2, &NameGad);
  628.     SetUpBorder(&Border3, &TranspGad);
  629.  
  630. #if defined(REQLIB) || defined(ASLLIB)
  631. #ifdef REQLIB
  632. #ifdef ASLLIB
  633.     if ((NameFR) || (AslNameFR))
  634. #else    /* ASLLIB */
  635.     if (NameFR)
  636. #endif    /* ASLLIB */
  637. #else
  638.     if (AslNameFR)
  639. #endif    /* REQLIB */
  640.     {
  641.         NameGad.Flags = GADGHCOMP;
  642.         NameGad.Activation = RELVERIFY;
  643.         NameGad.GadgetType = BOOLGADGET;
  644.         NameGad.SpecialInfo = NULL;
  645.     }
  646.     else
  647. #endif    /* REQLIB || ASLLIB */
  648.     {
  649.         NameGad.Flags = SELECTED;
  650.         NameGad.Activation = NULL;
  651.         NameGad.GadgetType = STRGADGET;
  652.         NameGad.SpecialInfo = (APTR) & NameSI;
  653.         ++NameGad.LeftEdge;    /* Adjust string gadget position */
  654.         ++NameGad.TopEdge;    /* Adjust string gadget position */
  655.     }
  656.  
  657.     strcpy(SaveName, "Snap.pic");
  658.     strcpy((char *)TranspBuf, "0");
  659.     TranspSI.LongInt = 0L;
  660.  
  661.     SetAPen(ControlWindow->RPort, 1L);
  662.     SetBPen(ControlWindow->RPort, 0L);
  663.     SetDrMd(ControlWindow->RPort, JAM2);
  664.     Move(ControlWindow->RPort,
  665.          (LONG) SaveGad.LeftEdge + 1,
  666.          (LONG) SaveGad.TopEdge + ControlWindow->RPort->Font->tf_Baseline + 1);
  667.     Text(ControlWindow->RPort, "Save as", 7L);
  668.     Move(ControlWindow->RPort,
  669.          (LONG) SaveGad.LeftEdge + 1,
  670.     (LONG) TranspGad.TopEdge + ControlWindow->RPort->Font->tf_Baseline);
  671.     Text(ControlWindow->RPort, "Transparent color", 17L);
  672.     AddGList(ControlWindow, &SaveGad, -1L, 3L, NULL);
  673.     RefreshGList(&SaveGad, ControlWindow, NULL, 3L);
  674.  
  675. #if defined(REQLIB) || defined(ASLLIB)
  676. #ifdef REQLIB
  677. #ifdef ASLLIB
  678.     if ((NameFR) || (AslNameFR))
  679. #else    /* ASLLIB */
  680.     if (NameFR)
  681. #endif    /* ASLLIB */
  682. #else
  683.     if (AslNameFR)
  684. #endif    /* REQLIB */
  685.     {
  686.         GadText(&NameGad, SaveName, 8L);
  687.     }
  688.     else
  689. #endif    /* REQLIB || ASLLIB */
  690.     {
  691.         ActivateGadget(&NameGad, ControlWindow, NULL);
  692.     }
  693.     return 1;
  694. }
  695.